package com.fancymusic.controller;


import com.fancymusic.entity.BaseResult;
import com.fancymusic.entity.MusicType;
import com.fancymusic.service.IMusicTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("musicType")
public class MusicTypeController {

    @Autowired
    IMusicTypeService iMusicTypeService;

    @RequestMapping("findAll")
    public BaseResult<MusicType> findAll(){


        BaseResult<MusicType> musicTypeBaseResult = new BaseResult<>();
        List<MusicType> musicType = iMusicTypeService.getMusicType();

        musicTypeBaseResult.setList(musicType);

        musicTypeBaseResult.setState(true);
        return musicTypeBaseResult;



    }
}
